package github.sf.fw.utils;

import github.sf.fw.tools.config.SystemConfig;

import java.util.UUID;

/**
 * @author zhoup
 * @since 2023/4/18
 */
public class Ids {
    private Ids() {
    }

    public static String getUUID() {
        return UUID.randomUUID().toString();
    }

    public static SnowflakeId getSnowflake() {
        return SnowflakeSingleton.instance;
    }

    private static class SnowflakeSingleton {
        private final static SnowflakeId instance = new SnowflakeId(SystemConfig.getDataWorkId(), SystemConfig.getDataCenterId());

    }
}
